package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jdk.jfr.Frequency;

import java.time.LocalDateTime;
@TableName("t_replay")
public class ReplayBean {
    @TableId(value = "pk_replayId",type = IdType.AUTO)
    private Integer id;
    @TableField("fk_postId")
    private Integer postId;
    @TableField(exist = false)
    private PostBean post;
    @TableField("r_title")
    private String title;
    @TableField("fk_userId")
    private Integer userId;
    @TableField(exist = false)
    private UserBean user;
    @TableField("r_content")
    private String content;
    @TableField("r_time")
    private LocalDateTime time=LocalDateTime.now();

    public ReplayBean() {
    }

    public ReplayBean(Integer postId, String title, Integer userId, String content) {
        this.postId = postId;
        this.title = title;
        this.userId = userId;
        this.content = content;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getPostId() {
        return postId;
    }

    public void setPostId(Integer postId) {
        this.postId = postId;
    }

    public PostBean getPost() {
        return post;
    }

    public void setPost(PostBean post) {
        this.post = post;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDateTime getTime() {
        return time;
    }

    public void setTime(LocalDateTime time) {
        this.time = time;
    }

    @Override
    public String toString() {
        return "ReplayBean{" +
                "id=" + id +
                ", postId=" + postId +
                ", post=" + post +
                ", title='" + title + '\'' +
                ", userId=" + userId +
                ", user=" + user +
                ", content='" + content + '\'' +
                ", time=" + time +
                "\n";
    }
}
